package models

import "time"

type  ItemPrj struct {
	ID				int					`gorm:"primary_key"`
	PrjName			string				`gorm:"size:64;not null;unique"`
	CreatedAt		time.Time			`json:"create_time"`
}

type ItemPlatfm struct {
	ID				int					`gorm:"primary_key"`
	Prj  			ItemPrj				`gorm:"foreignkey:PrjId"`
	PrjId			int
	PlatfmName		string				`gorm:"size:64;not null"`
	CodeVersion		string
	CreatedAt		time.Time			`json:"create_time"`
}


type ItemRelease struct {
	ID				int					`gorm:"primary_key"`
	Platfm  		ItemPlatfm			`gorm:"foreignkey:PlatfmID"`
	PlatfmID		int					`gorm:"unique"`
	CurVersion		string
	ReleaseHost		string
	Status			bool				`gorm:"force"`
	ProxyHost		string
	PackageTime 	string
	UpdatedAt 		time.Time			`json:"update_time"`
	CreatedAt		time.Time			`json:"create_time"`
}


type ItemBranch struct {
	ID				int					`gorm:"primary_key"`
	Platfm  		ItemPlatfm			`gorm:"foreignkey:PlatfmID"`
	PlatfmID		int
	BranchName		string
	BranchMsg		string
	CurVersion		string
	TestUrl			string
	ReleaseTime 	string
	CreatedAt		time.Time			`json:"create_time"`
}
